package managers;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;

import spotGUI.optionsGUI.OptionsFrame;

public class OptionsManager {

	private static OptionsManager sharedInstance = new OptionsManager();
	
	private HashMap<String, FastProperties> options;
	

	private OptionsManager() {
		options = new HashMap<String, FastProperties>();
	}

	public void addOptionGroup (String name, String path) throws FileNotFoundException, IOException {
		//relative or absolute path
		FastProperties temp = new FastProperties(path);
		temp.load();
		options.put(name, temp);
	}
	
	public void removeOptionGroup (String name) throws FileNotFoundException, IOException {
		options.remove(name);
	}
	
	public void storeOptionGroup (String name) {
		options.get(name).store();
	}
	
	public FastProperties getOptionGroup (String name) {
		return options.get(name);
	}
	
	
	public static OptionsManager getSharedInstance() {
		return sharedInstance;
	}

}
